package com.his.registration.controller;

import com.his.common.Result;
import com.his.dto.RegistLevelIdFee;
import com.his.registration.service.RegistLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: workspace-idea
 * @BelongsPackage: com.his.registration.controller
 * @Author: ZhangYing
 * @Date: 2023/7/1 16:32
 * @Description:
 */
@RestController
@CrossOrigin
@RequestMapping("/registLevel")
public class RegistLevelController {
    @Autowired
    private RegistLevelService registLevelService;

    @RequestMapping("/getAllRegistLevel")
    public Result getAllRegistLevel(){
        List<String> list = registLevelService.select();
        return Result.success(list);
    }

    @RequestMapping("/getIdFeebyName")
    public Result getIdFeebyName(String registName){
        RegistLevelIdFee registLevelIdFee = registLevelService.getIdFeeByName(registName);
        System.out.println(registLevelIdFee.toString());
        return Result.success(registLevelIdFee);
    }
}
